<template>
  <div>
    <h1>生命周期  父组件{{ num }}
        <button @click="addNum">修改</button>
    </h1>
    <my-child :n="num"></my-child>
   
  </div>
</template>

<script>
import Child1Vue from '../components/Child1.vue'

export default {
    data(){
        return  {
            num:10
        }
    },
    methods:{
        addNum(){
            this.num++
        }
    },
    components:{
        "myChild":Child1Vue
    },
    beforeCreate(){
        console.log(1)
    },
    created(){
        console.log(2)
    },
    beforeMount() {
        console.log(3)
    },
    mounted() {
        console.log(4)
    },
    beforeUpdate() {
        console.log(5)
    },
    updated() {
        console.log(6)
    },
    beforeDestroy() {
        console.log(7)
    },
    destroyed() {
        console.log(8)
    },


}
</script>

<style>

</style>